package com.zlq.ajaxjson.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/hello2Controller")
public class Hello2Controller extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name = req.getParameter("name");
        String sex = req.getParameter("sex");

        System.out.println(name);
        System.out.println(sex);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("zhxasxhvasv");
        String oo = req.getParameter("oo");
        System.out.println(oo);
        PrintWriter out = resp.getWriter();
        out.write("cccc");
        out.flush();
        out.close();
    }
}
